using Chaotic.DataBase.DataAccess;
using Oracle.ManagedDataAccess.Client;

namespace Chaotic.DataBase.OracleAccess;

public class DbTypeEnum : IDbTypeEnum
{
	public int GetTypeEnum(string? dbType)
	{
		return dbType.Trim().ToUpper() switch
		{
			"BYTE" => OracleDbType.Byte.GetHashCode(), 
			"CLOB" => OracleDbType.Clob.GetHashCode(), 
			"INT32" => OracleDbType.Int32.GetHashCode(), 
			"CHAR" => OracleDbType.Char.GetHashCode(), 
			"DATETIME" => OracleDbType.Date.GetHashCode(), 
			"DOUBLE" => OracleDbType.Double.GetHashCode(), 
			"FLOAT" => OracleDbType.Double.GetHashCode(), 
			"BLOB" => OracleDbType.Blob.GetHashCode(), 
			"INT16" => OracleDbType.Int16.GetHashCode(), 
			"NUMBER" => OracleDbType.Int32.GetHashCode(), 
			"TIMESTAMP" => OracleDbType.TimeStamp.GetHashCode(), 
			"VARCHAR" => OracleDbType.Varchar2.GetHashCode(), 
			_ => 0, 
		};
	}
}
